package com.hackerrank.challenges.gemstones;

import java.util.Scanner;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt(), cnt[] = new int[26];
		in.nextLine();
		int ng = 0;
		for(int i = 0; i < N; i++) {
			String s = in.nextLine();
			char c[] = s.toCharArray();
			ng = 0;
			for(int j = 0; j < c.length; j++) {
				if(cnt[c[j] - 'a'] == i) {
					cnt[c[j] - 'a'] = i + 1;
					ng++;
				}
			}
		}
		System.out.println(ng);
	}
}
